package com.wjk.kylin.modules.system.dict.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.wjk.kylin.core.common.entity.BaseEntity;
import com.wjk.kylin.core.common.valid.insert;
import com.wjk.kylin.core.common.valid.update;
import lombok.Data;
import lombok.ToString;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * <p>
 * 字典类型表
 * </p>
 *
 * @author wangjkui
 * @date 2020/6/7
 */
@Data
@ToString
@TableName("sys_dict_type")
public class DictType extends BaseEntity<DictType> {

    /** 字典类型 */
    @NotBlank(message = "字典类型不能为空",groups = {insert.class, update.class})
    @Size(min = 0, max = 100, message = "字典类型类型长度不能超过100个字符",groups = {insert.class, update.class})
    @TableField("type")
    private String type;

    /** 字典名称 */
    @NotBlank(message = "字典名称不能为空",groups = insert.class)
    @Size(min = 0, max = 100, message = "字典类型名称长度不能超过100个字符",groups = {insert.class, update.class})
    @TableField("name")
    private String name;

    /** 状态（0正常 1禁用） */
    @TableField("status")
    @Pattern(regexp="^[0-1]",message = "状态只能为0或1",groups = {insert.class, update.class})
    private String status;

}
